package chain.example.delivery.chain;


import chain.example.delivery.DeliveryState;
import chain.example.delivery.decorate.NoneInfo;
import chain.example.delivery.decorate.RealDeliveryInfo;
import chain.example.delivery.decorate.StateInfo;

public class RealDeliveryChain implements Delivery {

    @Override
    public StateInfo doDelivery(int state, DeliveryChain wrapperChain) {
        if (state == DeliveryState.REAL_DELIVERY.getState()) {
            return new RealDeliveryInfo(new NoneInfo());
        }
         return wrapperChain.doChain(state);
    }
}
